package com.mediator.demo2.impl;

import java.util.ArrayList;

import com.mediator.demo2.face.Colleage;
import com.mediator.demo2.face.Mediator;

public class QQMediator extends Mediator {

	public QQMediator() {
		studentList = new ArrayList<Colleage>();
	}

	public void notify(Colleage student) {
		student.talk();
		for (int i = 0; i < studentList.size(); ++i) {
			// 不是说话者
			if (student != studentList.get(i)) {
				studentList.get(i).talk();
			}
		}
	};

	public void chart(Colleage student1, Colleage student2) {
		student1.talk();
		student2.talk();
	}

}
